<template>
  <MainLayout title="个人信息">
    <view class="section">
      <view class="row"><text class="label">用户名：</text><text>{{ user.username || '-' }}</text></view>
      <view class="row"><text class="label">角色：</text><text>{{ user.role || '-' }}</text></view>
    </view>
  </MainLayout>
</template>

<script setup lang="ts">
import { reactive, onMounted } from 'vue'
import MainLayout from '@/layouts/MainLayout.vue'

const user = reactive<any>({})

onMounted(() => {
  // 简单示例：从本地缓存拿登录后写入的 user
  const u = uni.getStorageSync('USER_INFO')
  Object.assign(user, u || {})
})
</script>

<style scoped>
.section{ padding: 24rpx; }
.row{ background:#fff; border-radius:12rpx; padding:24rpx; margin-bottom:16rpx; }
.label{ color:#666; margin-right: 8rpx; }
</style>
